<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        Commands\Inspire::class,
        Commands\Statistic::class,
        Commands\StatisticYear::class,
        Commands\RecordForExcel::class,
        Commands\RecordYear::class,
        Commands\RecordRepair::class
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        echo date('Y-m-d H:i:s').' >> ';
        $schedule->command('statistic', ['device_day_energy'])->dailyAt('22:00')->withoutOverlapping();
        $schedule->command('statistic', ['site_day_energy'])->dailyAt('23:00')->withoutOverlapping();
        $schedule->command('RecordForExcel')->dailyAt('20:00');
//        $schedule->command('RecordForExcel')->dailyAt('14:49');
//        $schedule->command('statistic', ['device_day_energy'])->dailyAt("18:42");
//        $schedule->command('statistic', ['site_day_energy'])->dailyAt('18:42');
//        $schedule->command('RecordForExcel')->dailyAt('12:27');
//        $schedule->command('RecordRepair')->everyMinute();
//        $schedule->command('StatisticYear')->dailyAt('02:26');
//        $schedule->command('StatisticYear')->dailyAt('17:21');
//        $schedule->command('RecordYear')->dailyAt('18:07');
//        $schedule->command('RecordYear')->everyMinute();
    }


}
